package config

import (
	"github.com/zeromicro/go-zero/rest"
)

// Config 应用配置
type Config struct {
	rest.RestConf

	// 数据库配置
	Database struct {
		Driver      string
		Source      string
		ShowSql     bool
		MaxIdleConn int
		MaxOpenConn int
		LogLevel    string
	}

	// Redis配置
	Redis struct {
		Host     string
		Type     string
		Pass     string
		DB       int
		PoolSize int
	}

	// JWT认证配置
	Auth struct {
		AccessSecret    string
		AccessExpire    int64
		RefreshSecret   string
		RefreshExpire   int64
		AllowedOrigins  []string
		AllowedMethods  []string
		AllowedHeaders  []string
		ExposedHeaders  []string
		AllowCredential bool
	}

	// 本地存储配置
	Storage struct {
		Upload     string
		AvatarPath string
	}
}
